package com.glamour.hlcity.common.util;

import java.io.Serializable;

/**
 * LOG日志对象
 * @author zhaoxing.liuzx
 *
 */
public class TemplatedLog implements Serializable {

	private static final long serialVersionUID = 2577435398750314236L;
	private String template;
    private Object[] params;

    /**
     * 实例化 TemplatedLog 对象
     * template的格式请参见：@see java.text.MessageFormat
     * 
     * @param template 模板字符串或是模板字符串在properties文件中的key
     * @param params 注入参数
     * @return 
     */
    public static TemplatedLog log(String template, Object... params) {
        return new TemplatedLog().setTemplate(template).setParams(params);
    }

    public TemplatedLog setTemplate(String template) {
        this.template = template;
        return this;
    }

    public TemplatedLog setParams(Object... params) {
        this.params = params;
        return this;
    }

    public Object[] getParams() {
        return params;
    }

    public String getTemplate() {
        return template;
    }
}